package com.vcc.data.mapper;


import cn.hutool.core.date.DateTime;
import com.mybatisflex.core.BaseMapper;
import com.vcc.data.entity.Withdraw;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;

@Mapper
public interface WithdrawMapper extends BaseMapper<Withdraw> {

    @Select("SELECT COUNT(amount) FROM vcc_withdraw WHERE user_id = #{userId} AND request_date >= #{startDate} AND request_date <= #{endDate}")
    BigDecimal getDaySumSubmitAmount(@Param("userId") Long userId, @Param("startDate") DateTime startDate, @Param("endDate") DateTime endDate);

}
